<template>
  <!-- 检查结论 -->
    <el-form inline :model="dataForm" readonly>
      <el-divider content-position="left">验光信息</el-divider>
      <el-row class="bg-row">
        <el-form-item label="验光号">
          <el-input  v-model="checkData.checkNumber" readonly></el-input>
        </el-form-item>
        <el-form-item label="验光师">
          <el-input  v-model="checkData.checkerName" readonly></el-input>
        </el-form-item>
        <el-form-item label="日期">
          <el-input  v-model="checkData.checkDate" readonly></el-input>
        </el-form-item>
      </el-row>
      <el-divider content-position="left">顾客资料</el-divider>
      <el-row class="bg-row">
        <el-form-item label="卡号">
          <el-input v-model="customerData.customerCard"></el-input>
        </el-form-item>
        <el-form-item label="姓名">
          <el-input class="width-125"  v-model="customerData.name" readonly></el-input>
        </el-form-item>
        <el-form-item label="性别">
          <el-input class="width-125" v-if="customerData.gender == '0'" value="男" readonly></el-input>
          <el-input class="width-125" v-if="customerData.gender == '1'" value="女" readonly></el-input>
        </el-form-item>
        <el-form-item label="年龄">
          <el-input class="width-125"  v-model="customerData.age" readonly></el-input>
        </el-form-item>
        <el-form-item label="电话">
          <el-input class="width-125"  v-model="customerData.phone1" readonly></el-input>
        </el-form-item>
      </el-row>
      <el-divider content-position="left">眼睛健康评估</el-divider>
      <el-row class="bg-row">
        <el-form-item label="屈光不正">
          <el-form-item label="近视眼">
            <el-select v-model="dataForm.nearEye" clearable>
              <el-option v-for="item in bizData.refractionData" :value="item.value" :label="item.label" :key="item.value"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="远视眼">
            <el-select v-model="dataForm.farEye" clearable>
              <el-option v-for="item in bizData.refractionData" :value="item.value" :label="item.label" :key="item.value"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="散光">
            <el-select v-model="dataForm.astigmia" clearable>
              <el-option v-for="item in bizData.astigmiaData" :value="item.value" :label="item.label" :key="item.value"></el-option>
            </el-select>
          </el-form-item>
        </el-form-item>
      </el-row>
      <el-row class="bg-row">
        <el-form-item label="双眼视功能评估">
          <el-checkbox-group v-model="estimate">
            <el-checkbox label="A258">正常</el-checkbox>
            <el-checkbox label="A259">调节不足</el-checkbox>
            <el-checkbox label="A260">调节过度</el-checkbox>
            <el-checkbox label="A261">调节灵敏度异常</el-checkbox>
            <el-checkbox label="A262">集合过度</el-checkbox>
            <el-checkbox label="A263">集合不足</el-checkbox>
            <el-checkbox label="A264">内隐斜</el-checkbox>
            <el-checkbox label="A265">外隐斜</el-checkbox>
            <el-checkbox label="A266">眼球运动训练</el-checkbox>
            <el-checkbox label="A267">其他</el-checkbox>
          </el-checkbox-group>
        </el-form-item>
      </el-row>
      <el-divider content-position="left">建议矫正方案</el-divider>
      <el-row class="bg-row">
        <el-form-item label="框架眼镜">
          <el-checkbox-group v-model="glassTypes">
            <el-checkbox label="A268">非球面</el-checkbox>
            <el-checkbox label="A269">球面</el-checkbox>
            <el-checkbox label="A270">渐进多焦点</el-checkbox>
            <el-checkbox label="A271">抗疲劳</el-checkbox>
            <el-checkbox label="A272">变色片</el-checkbox>
          </el-checkbox-group>
        </el-form-item>
      </el-row>
      <el-row class="bg-row">
        <el-form-item label="角膜接触镜">
          <el-checkbox-group v-model="touchGlass">
            <el-checkbox label="A273">OK</el-checkbox>
            <el-checkbox label="A274">RPG</el-checkbox>
            <el-checkbox label="A275">散光</el-checkbox>
            <el-checkbox label="A276">传统型</el-checkbox>
            <el-checkbox label="A277">抛弃型</el-checkbox>
          </el-checkbox-group>
        </el-form-item>
      </el-row>
      <el-row class="bg-row">
        <el-form-item label="视觉训练">
          <el-checkbox-group v-model="trainTypes">
            <el-checkbox label="A278">调节训练</el-checkbox>
            <el-checkbox label="A279">融像训练</el-checkbox>
            <el-checkbox label="A280">精细训练</el-checkbox>
            <el-checkbox label="A281">视认知训练</el-checkbox>
            <el-checkbox label="A282">加强散开训练</el-checkbox>
            <el-checkbox label="A283">加强集合训练</el-checkbox>
            <el-checkbox label="A284">加强调节放松训练</el-checkbox>
          </el-checkbox-group>
        </el-form-item>
      </el-row>
      <el-divider content-position="left">医嘱</el-divider>
      <el-row class="bg-row">
        <el-form-item label="医嘱" class="miui-textarea" style="width: 100%;">
          <el-input type="textarea" v-model="dataForm.doctorSay" :rows="3" style="width: 100%;"></el-input>
        </el-form-item>
      </el-row>
      <el-divider content-position="left">双眼视功能检查</el-divider>
      <el-row class="bg-row">
        <el-form-item label="处方类型">
          <el-row :gutter="5">
            <el-col :span="16">
              <el-select v-model="dataForm.optType" clearable>
                <el-option v-for="item in optOptions" :value="item.value" :label="item.label" :key="item.value"></el-option>
              </el-select>
            </el-col>
          </el-row>
        </el-form-item>
      </el-row>
      <el-row v-for="(item,index) in dataForm.chkOptometryList" v-key="index">
        <table class="miui-table" v-if="item.optType == '1'">
          <tr>
            <td :colspan="9">
              <span>框架--远用</span>
            </td>
          </tr>
          <tr>
            <td width="50px"></td>
            <td>球镜</td>
            <td>柱镜</td>
            <td>轴向</td>
            <td>三棱镜</td>
            <td>基底</td>
            <td>远用瞳距(mm)</td>
            <td>瞳高(mm)</td>
            <td>远用VA</td>
          </tr>
          <tr>
            <td>OD</td>
            <td>
              <el-form-item :prop="'chkOptometryList.'+index+'.ballGlassOd'">
                <el-input v-model="item.ballGlassOd"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item :prop="'chkOptometryList.'+index+'.postGlassOd'">
                <el-input v-model="item.postGlassOd"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item :prop="'chkOptometryList.'+index+'.axesOd'">
                <el-input v-model="item.axesOd"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="arriseGlassOd">
                <el-input v-model="item.arriseGlassOd"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="basisOd">
                <el-select v-model="item.basisOd" clearable>
                  <el-option v-for="item in bizData.basalTypeData" :value="item.value" :label="item.label" :key="item.value"></el-option>
                </el-select>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="farPupilDistanceOd">
                <el-input v-model="item.farPupilDistanceOd"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="pupilHighOd">
                <el-input v-model="item.pupilHighOd"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="farUseOd">
                <el-input v-model="item.farUseOd"></el-input>
              </el-form-item>
            </td>
          </tr>
          <tr>
            <td>OS</td>
            <td>
              <el-form-item :prop="'chkOptometryList.'+index+'.ballGlassOs'">
                <el-input v-model="item.ballGlassOs"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item :prop="'chkOptometryList.'+index+'.postGlassOs'">
                <el-input v-model="item.postGlassOs"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item :prop="'chkOptometryList.'+index+'.axesOs'">
                <el-input v-model="item.axesOs"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="arriseGlassOs">
                <el-input v-model="item.arriseGlassOs"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="basisOs">
                <el-select v-model="item.basisOs" clearable>
                  <el-option v-for="item in bizData.basalTypeData" :value="item.value" :label="item.label" :key="item.value"></el-option>
                </el-select>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="farPupilDistanceOs">
                <el-input v-model="item.farPupilDistanceOs"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="pupilHighOs">
                <el-input v-model="item.pupilHighOs"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="farUseOs">
                <el-input v-model="item.farUseOs"></el-input>
              </el-form-item>
            </td>
          </tr>
          <tr>
            <td :colspan="3">
              <el-form-item label="建议镜框">
                <el-select v-model="item.suggestGlass">
                  <el-option v-for="item in bizData.suggestFrame" :value="item.value" :label="item.label" :key="item.value"></el-option>
                </el-select>
              </el-form-item>
            </td>
            <td :colspan="3">
              <el-form-item label="建议镜片材质">
                <el-select v-model="item.suggestMaterial">
                  <el-option v-for="item in bizData.glassmaterialsData" :value="item.value" :label="item.label" :key="item.value"></el-option>
                </el-select>
              </el-form-item>
            </td>
            <td :colspan="3">
              <el-form-item label="处理方式">
                <el-select v-model="item.handleMethod">
                  <el-option v-for="item in bizData.handleMode" :value="item.value" :label="item.label" :key="item.value"></el-option>
                </el-select>
              </el-form-item>
            </td>
          </tr>
          <tr>
            <td :colspan="9">
              <el-form-item label="备注" class="miui-textarea" style="width: 100%;">
                <el-input type="textarea" style="width: 100%;" v-model="item.dignosisres"></el-input>
              </el-form-item>
            </td>
          </tr>
        </table>

        <table class="miui-table" v-if="item.optType == '2'">
          <tr>
            <td :colspan="9">
              <span>框架--近用</span>
            </td>
          </tr>
          <tr>
            <td width="50px"></td>
            <td>球镜</td>
            <td>柱镜</td>
            <td>轴向</td>
            <td>三棱镜</td>
            <td>基底</td>
            <td>近用瞳距(mm)</td>
            <td>瞳高(mm)</td>
            <td>近用VA</td>
          </tr>
          <tr>
            <td>OD</td>
            <td>
              <el-form-item :prop="'chkOptometryList.'+index+'.ballGlassOd'">
                <el-input v-model="item.ballGlassOd"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item :prop="'chkOptometryList.'+index+'.postGlassOd'">
                <el-input v-model="item.postGlassOd"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item :prop="'chkOptometryList.'+index+'.axesOd'">
                <el-input v-model="item.axesOd"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="arriseGlassOd">
                <el-input v-model="item.arriseGlassOd"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="basisOd">
                <el-select v-model="item.basisOd" clearable>
                  <el-option v-for="item in bizData.basalTypeData" :value="item.value" :label="item.label" :key="item.value"></el-option>
                </el-select>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="nearPupilDistanceOd">
                <el-input v-model="item.nearPupilDistanceOd"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="pupilHighOd">
                <el-input v-model="item.pupilHighOd"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="nearUseOd">
                <el-input v-model="item.nearUseOd"></el-input>
              </el-form-item>
            </td>
          </tr>
          <tr>
            <td>OS</td>
            <td>
              <el-form-item :prop="'chkOptometryList.'+index+'.ballGlassOs'">
                <el-input v-model="item.ballGlassOs"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item :prop="'chkOptometryList.'+index+'.postGlassOs'">
                <el-input v-model="item.postGlassOs"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item :prop="'chkOptometryList.'+index+'.axesOs'">
                <el-input v-model="item.axesOs"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="arriseGlassOs">
                <el-input v-model="item.arriseGlassOs"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="basisOs">
                <el-select v-model="item.basisOs" clearable>
                  <el-option v-for="item in bizData.basalTypeData" :value="item.value" :label="item.label" :key="item.value"></el-option>
                </el-select>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="nearPupilDistanceOs">
                <el-input v-model="item.nearPupilDistanceOs"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="pupilHighOs">
                <el-input v-model="item.pupilHighOs"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="nearUseOs">
                <el-input v-model="item.nearUseOs"></el-input>
              </el-form-item>
            </td>
          </tr>
          <tr>
            <td :colspan="3">
              <el-form-item label="建议镜框">
                <el-select v-model="item.suggestGlass">
                  <el-option v-for="item in bizData.suggestFrame" :value="item.value" :label="item.label" :key="item.value"></el-option>
                </el-select>
              </el-form-item>
            </td>
            <td :colspan="3">
              <el-form-item label="建议镜片材质">
                <el-select v-model="item.suggestMaterial">
                  <el-option v-for="item in bizData.glassmaterialsData" :value="item.value" :label="item.label" :key="item.value"></el-option>
                </el-select>
              </el-form-item>
            </td>
            <td :colspan="3">
              <el-form-item label="处理方式">
                <el-select v-model="item.handleMethod">
                  <el-option v-for="item in bizData.handleMode" :value="item.value" :label="item.label" :key="item.value"></el-option>
                </el-select>
              </el-form-item>
            </td>
          </tr>
          <tr>
            <td :colspan="9">
              <el-form-item label="备注" class="miui-textarea" style="width: 100%;">
                <el-input type="textarea" style="width: 100%;" v-model="item.dignosisres"></el-input>
              </el-form-item>
            </td>
          </tr>
        </table>

        <table class="miui-table" v-if="item.optType == '3'">
          <tr>
            <td :colspan="12">
              <span>框架--渐进/双光</span>
            </td>
          </tr>
          <tr>
            <td width="50px"></td>
            <td>球镜</td>
            <td>柱镜</td>
            <td>轴向</td>
            <td>ADD</td>
            <td>三棱镜</td>
            <td>基底</td>
            <td>远用瞳距(mm)</td>
            <td>近用瞳距(mm)</td>
            <td>瞳高(mm)</td>
            <td>远用VA</td>
            <td>近用VA</td>
          </tr>
          <tr>
            <td>OD</td>
            <td>
              <el-form-item :prop="'chkOptometryList.'+index+'.ballGlassOd'">
                <el-input v-model="item.ballGlassOd"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item :prop="'chkOptometryList.'+index+'.postGlassOd'">
                <el-input v-model="item.postGlassOd"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item :prop="'chkOptometryList.'+index+'.axesOd'">
                <el-input v-model="item.axesOd"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="addOd">
                <el-input v-model="item.addOd"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="arriseGlassOd">
                <el-input v-model="item.arriseGlassOd"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="basisOd">
                <el-select v-model="item.basisOd" clearable>
                  <el-option v-for="item in bizData.basalTypeData" :value="item.value" :label="item.label" :key="item.value"></el-option>
                </el-select>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="farPupilDistanceOd">
                <el-input v-model="item.farPupilDistanceOd"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="nearPupilDistanceOd">
                <el-input v-model="item.nearPupilDistanceOd"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="pupilHighOd">
                <el-input v-model="item.pupilHighOd"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="farUseOd">
                <el-input v-model="item.farUseOd"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="nearUseOd">
                <el-input v-model="item.nearUseOd"></el-input>
              </el-form-item>
            </td>
          </tr>
          <tr>
            <td>OS</td>
            <td>
              <el-form-item :prop="'chkOptometryList.'+index+'.ballGlassOs'">
                <el-input v-model="item.ballGlassOs"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item :prop="'chkOptometryList.'+index+'.postGlassOs'">
                <el-input v-model="item.postGlassOs"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item :prop="'chkOptometryList.'+index+'.axesOs'">
                <el-input v-model="item.axesOs"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="addOs">
                <el-input v-model="item.addOs"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="arriseGlassOs">
                <el-input v-model="item.arriseGlassOs"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="basisOs">
                <el-select v-model="item.basisOs" clearable>
                  <el-option v-for="item in bizData.basalTypeData" :value="item.value" :label="item.label" :key="item.value"></el-option>
                </el-select>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="farPupilDistanceOs">
                <el-input v-model="item.farPupilDistanceOs"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="nearPupilDistanceOs">
                <el-input v-model="item.nearPupilDistanceOs"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="pupilHighOs">
                <el-input v-model="item.pupilHighOs"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="farUseOs">
                <el-input v-model="item.farUseOs"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="nearUseOs">
                <el-input v-model="item.nearUseOs"></el-input>
              </el-form-item>
            </td>
          </tr>
          <tr>
            <td :colspan="4">
              <el-form-item label="建议镜框">
                <el-select v-model="item.suggestGlass">
                  <el-option v-for="item in bizData.suggestFrame" :value="item.value" :label="item.label" :key="item.value"></el-option>
                </el-select>
              </el-form-item>
            </td>
            <td :colspan="4">
              <el-form-item label="建议镜片材质">
                <el-select v-model="item.suggestMaterial">
                  <el-option v-for="item in bizData.glassmaterialsData" :value="item.value" :label="item.label" :key="item.value"></el-option>
                </el-select>
              </el-form-item>
            </td>
            <td :colspan="4">
              <el-form-item label="处理方式">
                <el-select v-model="item.handleMethod">
                  <el-option v-for="item in bizData.handleMode" :value="item.value" :label="item.label" :key="item.value"></el-option>
                </el-select>
              </el-form-item>
            </td>
          </tr>
          <tr>
            <td :colspan="12">
              <el-form-item label="备注" class="miui-textarea" style="width: 100%;">
                <el-input type="textarea" style="width: 100%;" v-model="item.dignosisres"></el-input>
              </el-form-item>
            </td>
          </tr>
        </table>

        <table class="miui-table" v-if="item.optType == '4'">
          <tr>
            <td :colspan="15">
              <span>隐形</span>
            </td>
          </tr>
          <tr>
            <td width="50px"></td>
            <td>球镜</td>
            <td>柱镜</td>
            <td>轴向</td>
            <td>曲率1</td>
            <td>曲率2</td>
            <td>直径</td>
            <td>隐形VA</td>
            <td :colspan="5">隐形镜片</td>
            <td>片/盒数</td>
            <td>隐形处理方式</td>
          </tr>
          <tr>
            <td>OD</td>
            <td>
              <el-form-item :prop="'chkOptometryList.'+index+'.ballGlassOd'">
                <el-input class="width-60" v-model="item.ballGlassOd"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item :prop="'chkOptometryList.'+index+'.postGlassOd'">
                <el-input class="width-60" v-model="item.postGlassOd"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item :prop="'chkOptometryList.'+index+'.axesOd'">
                <el-input class="width-60" v-model="item.axesOd"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="curvatureOd">
                <el-input class="width-60" v-model="item.curvatureOd"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="curvatureOd2">
                <el-input class="width-60" v-model="item.curvatureOd2"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="diameterOd">
                <el-input class="width-60" v-model="item.diameterOd"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="invisibleOd">
                <el-input class="width-60" v-model="item.invisibleOd"></el-input>
              </el-form-item>
            </td>
            <td :colspan="5">
              <el-form-item>
                <el-input v-model="item.suitableGlassOdName" readonly>
                  <el-button type="primary" size="mini" slot="append" @click="openSuggestGoods(item,index,'suitableGlassOd','4')">选择</el-button>
                </el-input>
              </el-form-item>
              <el-form-item style="margin-left: 5px;">
                <el-button size="mini" @click="clearGoods('suitableGlassOd',index)">清空</el-button>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="numberBoxOd">
                <el-input class="width-60" v-model="item.numberBoxOd"></el-input>
              </el-form-item>
            </td>
            <td :rowspan="2">
              <el-form-item prop="handleMethod">
                <el-select style="width: 100px;" v-model="item.handleMethod" clearable>
                  <el-option v-for="item in bizData.handleMode" :value="item.value" :label="item.label" :key="item.value"></el-option>
                </el-select>
              </el-form-item>
            </td>
          </tr>
          <tr>
            <td>OS</td>
            <td>
              <el-form-item :prop="'chkOptometryList.'+index+'.ballGlassOs'">
                <el-input class="width-60" v-model="item.ballGlassOs"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item :prop="'chkOptometryList.'+index+'.postGlassOs'">
                <el-input class="width-60" v-model="item.postGlassOs"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item :prop="'chkOptometryList.'+index+'.axesOs'">
                <el-input class="width-60" v-model="item.axesOs"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="curvatureOs">
                <el-input class="width-60" v-model="item.curvatureOs"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="curvatureOs2">
                <el-input class="width-60" v-model="item.curvatureOs2"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="diameterOs">
                <el-input class="width-60" v-model="item.diameterOs"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="invisibleOs">
                <el-input class="width-60" v-model="item.invisibleOs"></el-input>
              </el-form-item>
            </td>
            <td :colspan="5">
              <el-form-item  prop="suitableGlassOs">
                <el-input v-model="item.suitableGlassOsName" readonly>
                  <el-button type="primary" size="mini" slot="append" @click="openSuggestGoods(item,index,'suitableGlassOs','4')">选择</el-button>
                </el-input>
              </el-form-item>
              <el-form-item style="margin-left: 5px;">
                <el-button size="mini" @click="clearGoods('suitableGlassOs',index)">清空</el-button>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="numberBoxOs">
                <el-input class="width-60" v-model="item.numberBoxOs"></el-input>
              </el-form-item>
            </td>
          </tr>
          <tr>
            <td :colspan="15">
              <el-form-item label="护理液品种" prop="suggestNursie">
                <el-input v-model="item.suggestNursieName" readonly>
                  <el-button type="primary" size="mini" slot="append" @click="openSuggestGoods(item,index,'suggestNursie','5')">选择</el-button>
                </el-input>
              </el-form-item>
              <el-form-item style="margin-left: 5px;">
                <el-button size="mini" @click="clearGoods('suggestNursie',index)">清空</el-button>
              </el-form-item>
            </td>
          </tr>
        </table>

        <table class="miui-table"v-if="item.optType == '5'">
          <tr>
            <td :colspan="9">
              <span>框架--中用</span>
            </td>
          </tr>
          <tr>
            <td width="50px"></td>
            <td>球镜</td>
            <td>柱镜</td>
            <td>轴向</td>
            <td>三棱镜</td>
            <td>基底</td>
            <td>中用瞳距(mm)</td>
            <td>瞳高(mm)</td>
            <td>中用VA</td>
          </tr>
          <tr>
            <td>OD</td>
            <td>
              <el-form-item :prop="'chkOptometryList.'+index+'.ballGlassOd'">
                <el-input v-model="item.ballGlassOd"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item :prop="'chkOptometryList.'+index+'.postGlassOd'">
                <el-input v-model="item.postGlassOd"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item :prop="'chkOptometryList.'+index+'.axesOd'">
                <el-input v-model="item.axesOd"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="arriseGlassOd">
                <el-input v-model="item.arriseGlassOd"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="basisOd">
                <el-select v-model="item.basisOd" clearable>
                  <el-option v-for="item in bizData.basalTypeData" :value="item.value" :label="item.label" :key="item.value"></el-option>
                </el-select>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="farPupilDistanceOd">
                <el-input v-model="item.farPupilDistanceOd"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="pupilHighOd">
                <el-input v-model="item.pupilHighOd"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="farUseOd">
                <el-input v-model="item.farUseOd"></el-input>
              </el-form-item>
            </td>
          </tr>
          <tr>
            <td>OS</td>
            <td>
              <el-form-item :prop="'chkOptometryList.'+index+'.ballGlassOs'">
                <el-input v-model="item.ballGlassOs"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item :prop="'chkOptometryList.'+index+'.postGlassOs'">
                <el-input v-model="item.postGlassOs"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item :prop="'chkOptometryList.'+index+'.axesOs'">
                <el-input v-model="item.axesOs"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="arriseGlassOs">
                <el-input v-model="item.arriseGlassOs"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="basisOs">
                <el-select v-model="item.basisOs" clearable>
                  <el-option v-for="item in bizData.basalTypeData" :value="item.value" :label="item.label" :key="item.value"></el-option>
                </el-select>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="farPupilDistanceOs">
                <el-input v-model="item.farPupilDistanceOs"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="pupilHighOs">
                <el-input v-model="item.pupilHighOs"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="farUseOs">
                <el-input v-model="item.farUseOs"></el-input>
              </el-form-item>
            </td>
          </tr>
          <tr>
            <td :colspan="3">
              <el-form-item label="建议镜框">
                <el-select v-model="item.suggestGlass">
                  <el-option v-for="item in bizData.suggestFrame" :value="item.value" :label="item.label" :key="item.value"></el-option>
                </el-select>
              </el-form-item>
            </td>
            <td :colspan="3">
              <el-form-item label="建议镜片材质">
                <el-select v-model="item.suggestMaterial">
                  <el-option v-for="item in bizData.glassmaterialsData" :value="item.value" :label="item.label" :key="item.value"></el-option>
                </el-select>
              </el-form-item>
            </td>
            <td :colspan="3">
              <el-form-item label="处理方式">
                <el-select v-model="item.handleMethod">
                  <el-option v-for="item in bizData.handleMode" :value="item.value" :label="item.label" :key="item.value"></el-option>
                </el-select>
              </el-form-item>
            </td>
          </tr>
          <tr>
            <td :colspan="9">
              <el-form-item label="备注" class="miui-textarea" style="width: 100%;">
                <el-input type="textarea" style="width: 100%;" v-model="item.dignosisres"></el-input>
              </el-form-item>
            </td>
          </tr>
        </table>

        <table class="miui-table" v-if="item.optType == '6'">
          <tr>
            <td :colspan="19">
              <span>角膜塑形镜</span>
            </td>
          </tr>
          <tr>
            <td width="50px"></td>
            <td :colspan="7">屈光处方及角膜参数</td>
            <td>试戴片</td>
            <td :colspan="5">订片参数</td>
            <td :colspan="5"></td>
          </tr>
          <tr>
            <td></td>
            <td>球镜</td>
            <td>柱镜</td>
            <td>轴向</td>
            <td>平K</td>
            <td>陡K</td>
            <td>e值</td>
            <td>角膜直径</td>
            <td>K</td>
            <td>K1</td>
            <td>k2</td>
            <td>光度</td>
            <td>降幅</td>
            <td>直径</td>
            <td :colspan="5">隐形镜片</td>
          </tr>
          <tr>
            <td>OD</td>
            <td>
              <el-form-item :prop="'chkOptometryList.'+index+'.ballGlassOd'">
                <el-input class="width-60" v-model="item.ballGlassOd"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item :prop="'chkOptometryList.'+index+'.postGlassOd'">
                <el-input class="width-60" v-model="item.postGlassOd"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item :prop="'chkOptometryList.'+index+'.axesOd'">
                <el-input class="width-40" v-model="item.axesOd"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="smoothKOd">
                <el-input class="width-40" v-model="item.smoothKOd"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="steepKOd">
                <el-input class="width-40" v-model="item.steepKOd"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="valueEOd">
                <el-input class="width-40" v-model="item.valueEOd"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="cornealDiameterOd">
                <el-input class="width-60" v-model="item.cornealDiameterOd"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="tryKOd">
                <el-input class="width-60" v-model="item.tryKOd"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="k1Od">
                <el-input class="width-40" v-model="item.k1Od"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="k2Od">
                <el-input class="width-40" v-model="item.k2Od"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="luminosityOd">
                <el-input class="width-40" v-model="item.luminosityOd"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="declineOd">
                <el-input class="width-40" v-model="item.declineOd"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="diameterOd">
                <el-input class="width-40" v-model="item.diameterOd"></el-input>
              </el-form-item>
            </td>
            <td :colspan="5">
              <el-form-item>
                <el-input v-model="item.suitableGlassOdName" readonly>
                  <el-button type="primary" size="mini" slot="append" @click="openSuggestGoods(item,index,'suitableGlassOd','4')">选择</el-button>
                </el-input>
              </el-form-item>
              <el-form-item style="margin-left: 5px;">
                <el-button size="mini" @click="clearGoods('suitableGlassOd',index)">清空</el-button>
              </el-form-item>
            </td>
          </tr>
          <tr>
            <td>OS</td>
            <td>
              <el-form-item :prop="'chkOptometryList.'+index+'.ballGlassOs'">
                <el-input class="width-60" v-model="item.ballGlassOs"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item :prop="'chkOptometryList.'+index+'.postGlassOs'">
                <el-input class="width-60" v-model="item.postGlassOs"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item :prop="'chkOptometryList.'+index+'.axesOs'">
                <el-input class="width-40" v-model="item.axesOs"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="smoothKOs">
                <el-input class="width-40" v-model="item.smoothKOs"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="steepKOs">
                <el-input class="width-40" v-model="item.steepKOs"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="valueEOs">
                <el-input class="width-40" v-model="item.valueEOs"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="cornealDiameterOs">
                <el-input class="width-60" v-model="item.cornealDiameterOs"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="tryKOs">
                <el-input class="width-60" v-model="item.tryKOs"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="k1Os">
                <el-input class="width-40" v-model="item.k1Os"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="k2Os">
                <el-input class="width-40" v-model="item.k2Os"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="luminosityOs">
                <el-input class="width-40" v-model="item.luminosityOs"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="declineOs">
                <el-input class="width-40" v-model="item.declineOs"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="diameterOs">
                <el-input class="width-40" v-model="item.diameterOs"></el-input>
              </el-form-item>
            </td>
            <td :colspan="5">
              <el-form-item>
                <el-input v-model="item.suitableGlassOsName" readonly>
                  <el-button type="primary" size="mini" slot="append" @click="openSuggestGoods(item,index,'suitableGlassOs','4')">选择</el-button>
                </el-input>
              </el-form-item>
              <el-form-item style="margin-left: 5px;">
                <el-button size="mini" @click="clearGoods('suitableGlassOs',index)">清空</el-button>
              </el-form-item>
            </td>
          </tr>
        </table>

        <table class="miui-table" v-if="item.optType == '7'">
          <tr>
            <td :colspan="10">
              <span>视觉训练</span>
            </td>
          </tr>
          <tr>
            <td width="50px"></td>
            <td>球镜</td>
            <td>柱镜</td>
            <td>轴向</td>
            <td>三棱镜</td>
            <td>基底</td>
            <td>远用瞳距(mm)</td>
            <td>近用瞳距(mm)</td>
            <td>远用VA</td>
            <td>近用VA</td>
          </tr>
          <tr>
            <td>OD</td>
            <td>
              <el-form-item :prop="'chkOptometryList.'+index+'.ballGlassOd'">
                <el-input v-model="item.ballGlassOd"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item :prop="'chkOptometryList.'+index+'.postGlassOd'">
                <el-input v-model="item.postGlassOd"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item :prop="'chkOptometryList.'+index+'.axesOd'">
                <el-input v-model="item.axesOd"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="arriseGlassOd">
                <el-input v-model="item.arriseGlassOd"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="basisOd">
                <el-select v-model="item.basisOd" clearable>
                  <el-option v-for="item in bizData.basalTypeData" :value="item.value" :label="item.label" :key="item.value"></el-option>
                </el-select>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="farPupilDistanceOd">
                <el-input v-model="item.farPupilDistanceOd"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="nearPupilDistanceOd">
                <el-input v-model="item.nearPupilDistanceOd"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="farUseOd">
                <el-input v-model="item.farUseOd"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="nearUseOd">
                <el-input v-model="item.nearUseOd"></el-input>
              </el-form-item>
            </td>
          </tr>
          <tr>
            <td>OS</td>
            <td>
              <el-form-item :prop="'chkOptometryList.'+index+'.ballGlassOs'">
                <el-input v-model="item.ballGlassOs"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item :prop="'chkOptometryList.'+index+'.postGlassOs'">
                <el-input v-model="item.postGlassOs"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item :prop="'chkOptometryList.'+index+'.axesOs'">
                <el-input v-model="item.axesOs"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="arriseGlassOs">
                <el-input v-model="item.arriseGlassOs"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="basisOs">
                <el-select v-model="item.basisOs" clearable>
                  <el-option v-for="item in bizData.basalTypeData" :value="item.value" :label="item.label" :key="item.value"></el-option>
                </el-select>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="farPupilDistanceOs">
                <el-input v-model="item.farPupilDistanceOs"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="nearPupilDistanceOs">
                <el-input v-model="item.nearPupilDistanceOs"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="farUseOs">
                <el-input v-model="item.farUseOs"></el-input>
              </el-form-item>
            </td>
            <td>
              <el-form-item prop="nearUseOs">
                <el-input v-model="item.nearUseOs"></el-input>
              </el-form-item>
            </td>
          </tr>
          <tr>
            <td :colspan="5">
              <el-form-item label="家庭训练">
                <el-form-item>
                  <el-input v-model="item.familyTransName" readonly>
                    <el-button type="primary" size="mini" slot="append" @click="openSuggestGoods(item,index,'familyTrans','9')">选择</el-button>
                  </el-input>
                </el-form-item>
                <el-form-item style="margin-left: 5px;">
                  <el-button size="mini" @click="clearGoods('familyTrans',index)">清空</el-button>
                </el-form-item>
              </el-form-item>
            </td>
            <td :colspan="5">
              <el-form-item label="训练室训练">
                <el-form-item>
                  <el-input v-model="item.trainRoomsName" readonly>
                    <el-button type="primary" size="mini" slot="append" @click="openSuggestGoods(item,index,'trainRooms','9')">选择</el-button>
                  </el-input>
                </el-form-item>
                <el-form-item style="margin-left: 5px;">
                  <el-button size="mini" @click="clearGoods('trainRooms',index)">清空</el-button>
                </el-form-item>
              </el-form-item>
            </td>
          </tr>
          <tr>
            <td :colspan="10">
              <el-form-item label="备注" class="miui-textarea" style="width: 100%;">
                <el-input type="textarea" style="width: 100%;"></el-input>
              </el-form-item>
            </td>
          </tr>
        </table>
      </el-row>
      <el-row class="bg-row" style="margin-top: 20px;">
        <el-form-item label="戴镜方式">
          <el-select v-model="dataForm.taketype" clearable>
            <el-option v-for="item in bizData.taketype" :value="item.value" :label="item.label" :key="item.value"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="复诊时间">
          <el-input v-model="dataForm.secCheckDate"></el-input>
        </el-form-item>
      </el-row>
    </el-form>
</template>

<script>
  import { mapGetters } from 'vuex'
  import { filterParams } from '@/util/tools'
  import { addChkOptometryBasic, saveCheckResultData, getCheckResult } from '@/api/admin/optometry/optometry'


  import { getCustomerOptometryByBillId } from '@/api/eims/customer'

  export default {
    data() {
      return {
        visible: false,
        activeName: 'six',
        id: '',
        checkData: {
          checkNumber: '',
          checker: '',
          checkDate: ''
        },
        estimate: [],
        glassTypes: [],
        touchGlass: [],
        trainTypes: [],
        dataForm:{
          doctorsay: '',
          optType: '',
          chkOptometryList: [],
          taketype: '',
          secCheckDate: ''
        },
        chkDatas:[],
        customerData: {
            customerCard: '',
            id: '',
            name: '',
            gender: '',
            age: '',
            phone1: '',
            cardType: '',
            integral: ''
        },
        checkList: [],
        optOptions: [
          { value: '1', label: '远用' },
          { value: '2', label: '近用' },
          { value: '3', label: '渐进/双光' },
          { value: '4', label: '隐形' },
          { value: '5', label: '中用' },
          { value: '6', label: '角膜塑形' },
          { value: '7', label: '视觉训练' },
        ]
      }
    },
    components: {},
    computed: {
      ...mapGetters(['permissions', 'bizData', 'userInfo', 'isCollapse'])
    },
    methods: {
      init(data) {
        this.visible = true
        this.checkData = data.checkData
        this.customerData = data.customer
        this.dataForm.chkOptometryList = []
        this.billId = data.billId
        this.$nextTick(() => {
          if(this.billId){
            getCustomerOptometryByBillId(this.billId).then(response => {
              if(response.data.code == '0'){
                let resultData = result.data.data
                if(resultData.estimate){
                  this.estimate = resultData.estimate.split(',') || []
                }
                if(resultData.glassTypes){
                  this.glassTypes = resultData.glassTypes.split(',') || []
                }
                if(resultData.touchGlass){
                  this.touchGlass = resultData.touchGlass.split(',') || []
                }
                if(resultData.trainTypes){
                  this.trainTypes = resultData.trainTypes.split(',') || []
                }
                this.dataForm = resultData
              }else{
                this.$message.error(response.data.msg)
              }
            })
          }
        })
      }
    }
  }
</script>

<style lang="scss" scoped>
  .bg-row {
    // background-color: #cadee8;
    padding-left: 15px;
    padding-top: 5px;
  }
  .width-125 {
    width: 125px;
  }
  .miui-table {
    width: 100%;
    margin: 10px 0;
    background-color: #b1e2ec3b;
    tr th {
      background-color: #f4f5f7;
    }

    tr th, tr td {
      padding: 10px 3px;
      border: solid 1px #e7e7e7;
      text-align: center;
    }
    .miui-table-header td{
      background-color: #7898a8;
      color: #fff;
    }
    .miui-table-tbody{
      background-color: #cadee8;
    }
    .width-60 {
      width: 60px;
    }
    .width-40 {
      width: 40px;
    }
  }
</style>
